/**
 * 
 */
package megamek.common.actions;

import static org.junit.Assert.*;

import org.junit.After;
import org.junit.Before;
import org.junit.Test;
import megamek.common.Coords;

/**
 * @author Ruchi
 *
 */
public class DisplacementAttackActionTest {

	/** The displacement attack action. */
    DisplacementAttackAction action;

    /** The coordinates of the attack. */
    Coords coords;
    
	/**
	 * Setup the test case for all methods in the class
	 * @throws java.lang.Exception
	 */
	@Before
	public void setUp() throws Exception {
		coords = new Coords(2, 3);
        action = new DisplacementAttackAction(1, 1, coords);
	}

	/**
	 * @throws java.lang.Exception
	 */
	@After
	public void tearDown() throws Exception {
		coords = null;
		action = null;
	}


	/**
	 * Test method for 
	 * {@link megamek.common.actions.DisplacementAttackAction#DisplacementAttackAction(int, int, int, megamek.common.Coords)}.
	 */
	@Test
	public void testDisplacementAttackActionIntIntIntCoords() {
		DisplacementAttackAction disAtt = new DisplacementAttackAction(1, 1, 1, coords);
		assertEquals(coords, disAtt.getTargetPos());
	}

	/**
	 * Test method for 
	 * {@link megamek.common.actions.DisplacementAttackAction#setTargetPos(megamek.common.Coords)}.
	 */
	@Test
	public void testSetTargetPos() {
		action.setTargetPos(coords);

        assertEquals(coords, action.getTargetPos());
	}

}
